package com.ygqh.baby.service;

import java.util.List;

import com.ygqh.baby.ao.CheckStatus;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.model.VoteWorkListVo;
import com.ygqh.baby.model.YgVote;
import com.ygqh.baby.po.YgVoteWork;

/**
 * @author Ss
 */
public interface YgVoteWorkService {

	List<YgVoteWork> find();

	int findCount();

	YgVoteWork findById(Long id);

	int deleteSoft(Long[] ids);

	int deleteSoft(Long id);

	int save(YgVoteWork ygVoteWork);

	int update(YgVoteWork ygVoteWork);

	int saveOrUpdate(YgVoteWork ygVoteWork);

	ResultSet<YgVoteWork> search(QueryInfo queryInfo, String nickName, String voteBatchCode, CheckStatus checkStatus);

	List<VoteWorkListVo> findList(QueryInfo queryInfo, String babyName, String voteBatchCode, CheckStatus checkStatus);

	YgVoteWork findByVoteBatchCodeAndUserId(String voteBatchCode, Long userId, CheckStatus... checkStatus);

	/**
	 * 缓存中获取投票活动信息
	 *
	 * @return
	 */
	YgVote getVoteInfoFromRedis();

	/**
	 * 添加票数
	 *
	 * @param id
	 */
	void updateVoteCountToUp(Long id);

	/**
	 * 异步生成公众号二维码
	 *
	 * @param id
	 */
	void createQrCodeAsync(Long id);

	/**
	 * 获取二维码地址
	 *
	 * @param id
	 * @return
	 */
	String findQrCodeUrl(Long id);

	/**
	 * 排行榜
	 *
	 * @param voteBatchCode
	 * @param limit
	 * @return
	 */
	List<VoteWorkListVo> findListByLeaderboard(String voteBatchCode, Integer limit);
}
